<template>
  <div>
    <div
      class="banner"
      @click="handleBannerClick"
    >
      <img
        src="//img1.qunarzz.com/sight/p0/1511/25/254660a76f891cde90.water.jpg_600x330_1c9efecc.jpg"
        class="banner-img"
      >
      <div class="banner-info">
        <div class="banner-title">
          大连圣亚海洋世界(AAAA景区)
        </div>
        <div class="banner-number">
          <span class="iconfont banner-icon">&#xe692;</span>
          39
        </div>
      </div>
    </div>
    <CommonGallery
      :imgs="imgs"
      v-show="showGallery"
      @close="handleGalleryClose"
    />
  </div>
</template>

<script>
import CommonGallery from 'common/gallery/Gallery'
export default {
  name: 'DetailBanner',
  components: {
    CommonGallery
  },
  data () {
    return {
      imgs: ['http://img1.qunarzz.com/sight/p0/1411/47/350a32064cb266187ebb7c31d4824586.water.jpg_r_800x800_186bd6ca.jpg', 'http://img1.qunarzz.com/sight/p0/201301/08/467149a8bac4894393835fbb.jpg_r_800x800_e18f8eb7.jpg'],
      showGallery: false
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallery = true
    },
    handleGalleryClose () {
      this.showGallery = false
    }
  }
}
</script>

<style lang="stylus" scoped>
.banner
  position relative
  overflow hidden
  height 0
  padding-bottom 55%

  .banner-img
    width 100%

  .banner-info
    display flex
    position absolute
    left 0
    right 0
    bottom 0
    line-height 0.6rem
    color #fff
    background-image linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8))

    .banner-title
      flex 1
      font-size 0.32rem
      padding 0 0.2rem

    .banner-number
      height 0.4rem
      line-height 0.4rem
      margin-top 0.14rem
      padding 0 0.4rem
      border-radius 0.2rem
      font-size 0.24rem

      .banner-icon
        font-size 0.24rem
</style>
